﻿Public Class TakeFood_Page
    Public Sub Initialize()
        TableId.Text = ""
        Count.Text = ""
        MenuId.Text = ""
        RadioButtonAdd.IsChecked = True
        RadioButtonRemove.IsChecked = False
    End Sub

    Private Sub ButtonOK_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles ButtonOK.Click
        Try
            HallServe.dishorder(Convert.ToInt32(TableId.Text), MenuId.Text, Convert.ToInt32(Count.Text), RadioButtonAdd.IsChecked)
            MsgBox("点餐成功!")
        Catch err As Exception
            MsgBox(err.Message)
        End Try
    End Sub

    Private Sub ButtonReSet_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles ButtonReSet.Click
        Initialize()
    End Sub

    Private Sub TakeFood_Page_KeyDown(sender As Object, e As System.Windows.Input.KeyEventArgs) Handles Me.KeyDown
        If e.Key = Key.Return Then ButtonOK_Click(sender, New RoutedEventArgs)
    End Sub
End Class
